import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long m = in.nextLong();

        int []a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        int []b = new int[n];
        for (int j = 1; j < n; j++) {
            b[j] = in.nextInt();
        }
        List<Integer> al = new ArrayList<>();
        List<Integer> bl = new ArrayList<>();

        int count = 0;
        long sum = 0;

        while (count < n) {
            al.add(a[count]);
            bl.add(b[count]);

            Collections.sort(al, new Comparator<Integer>() {
                public int compare(Integer o1, Integer o2) {
                    return o2 - o1;
                }
            });
            Collections.sort(bl, new Comparator<Integer>() {
                public int compare(Integer o1, Integer o2) {
                    return o2 - o1;
                }
            });

            for (int i = 0; i <= count; i++) {
                sum += (long)a[i] * b[i];
            }

            if (sum >= m) {
                System.out.println(count + 1);
                return;
            }
            count++;
        }
        System.out.println(-1);
    }

}